﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.ProductionManagement;

namespace Digitalmes.Model.ProductionManagement
{
    /// <summary>
    /// 过站信息表
    /// </summary>
	[Table("ProductionArchive")]

    [Display(Name = "_Model.ProdArchive")]
    public class ProductionArchive : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._ProdArchive._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._ProdArchive._Sn")]
        [Comment("追溯码")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string Sn { get; set; }
        [Display(Name = "_Model._ProdArchive._ProductId")]
        [Comment("产品Id")]
        public long? ProductId { get; set; }
        [Display(Name = "_Model._ProdArchive._ProductCode")]
        [Comment("产品编码")]
        public string ProductCode { get; set; }
        [Display(Name = "_Model._ProdArchive._Wo")]
        [Comment("工单号")]
        public string Wo { get; set; }
        [Display(Name = "_Model._ProdArchive._LineId")]
        [Comment("产线Id")]
        public long? LineId { get; set; }
        [Display(Name = "_Model._ProdArchive._LineCode")]
        [Comment("产线编号")]
        public string LineCode { get; set; }
        [Display(Name = "_Model._ProdArchive._OpId")]
        [Comment("工位 Id")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public long? OpId { get; set; }
        [Display(Name = "_Model._ProdArchive._OpCode")]
        [Comment("工位编号")]
        public string OpCode { get; set; }
        [Display(Name = "_Model._ProdArchive._RoutingId")]
        [Comment("工艺路线 Id")]
        public long? RoutingId { get; set; }
        [Display(Name = "_Model._ProdArchive._RoutingCode")]
        [Comment("工艺路线编号")]
        public string RoutingCode { get; set; }
        [Display(Name = "_Model._ProdArchive._InboundTime")]
        [Comment("工位进站时间")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public DateTime? InboundTime { get; set; }
        [Display(Name = "_Model._ProdArchive._OutboundTime")]
        [Comment("工位出站时间")]
        public DateTime? OutboundTime { get; set; }
        [Display(Name = "_Model._ProdArchive._Status")]
        [Comment("状态")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public SnStatusEnum? Status { get; set; }
        [Display(Name = "_Model._ProdArchive._Shift")]
        [Comment("班次")]
        public string Shift { get; set; }
        [Display(Name = "_Model._ProdArchive._CycleTime")]
        [Comment("用时(秒)")]
        [Precision(18,2)]
        public decimal? CycleTime { get; set; }
        [Display(Name = "_Model._ProdArchiveData._ArchiveId")]
        [InverseProperty("ArchiveId")]
        public List<ProductionArchiveData> ProdArchiveData_ArchiveId { get; set; }
        [Display(Name = "_Model._ProdArchive._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
